Skip to content

nfs: add support for modifying clients parameter via VolumeAttributesClass#6219

Draft
nixpanic wants to merge 2 commits intoceph:develfrom
nixpanic:ai/bob/nfs/ControllerModifyVolume/clients
Draft

nfs: add support for modifying clients parameter via VolumeAttributesClass#6219
nixpanic wants to merge 2 commits intoceph:develfrom
nixpanic:ai/bob/nfs/ControllerModifyVolume/clients

Conversation

@nixpanic
Copy link
Copy Markdown
Member

@nixpanic nixpanic commented Apr 2, 2026

Describe what this PR does

This PR adds support for modifying the NFS clients parameter using VolumeAttributesClass. This allows administrators to update the list of hostnames, networks, or IP addresses that are allowed to access an NFS export after the volume has been created, without needing to recreate the volume.

The implementation includes:

  • Support for the clients parameter in ControllerModifyVolume CSI method
  • Helper methods SetClients() and GetClients() in the NFSVolume type to persist the clients list in the CephFS journal
  • Comprehensive E2E test that validates the functionality by:
    • Creating a volume with restrictive clients (1.1.1.1)
    • Verifying that an app fails to mount with restrictive settings
    • Updating the clients parameter via VolumeAttributesClass to allow all clients (0.0.0.0/0)
    • Verifying that the app successfully mounts after the update
  • Updated documentation in example YAML files

Is there anything that requires special attention

Kubernetes Version Requirement: This feature requires Kubernetes >= 1.34, as VolumeAttributesClass is a newer Kubernetes feature. The E2E test includes a version check to skip on older clusters.

Backward Compatibility: This change is fully backward compatible. The clients parameter remains optional and existing volumes continue to work without modification. The feature only activates when a VolumeAttributesClass is applied to update the parameter.

Security Consideration: Administrators should be aware that updating the clients parameter can expand or restrict access to NFS exports. The E2E test demonstrates both restrictive and permissive configurations to validate proper behavior.

Related issues

This PR implements support for modifying NFS export access controls dynamically, which is useful for scenarios where access requirements change after volume provisioning.

Future concerns

  • Additional mutable parameters could be supported in future PRs (e.g., secType)
  • Consider adding validation for the clients parameter format to catch configuration errors early

Show available bot commands

These commands are normally not required, but in case of issues, leave any of
the following bot commands in an otherwise empty comment in this PR:

  • /retest ci/centos/<job-name>: retest the <job-name> after unrelated
    failure (please report the failure too!)

@mergify mergify bot added the component/nfs Issues related to NFS label Apr 2, 2026
@nixpanic
Copy link
Copy Markdown
Member Author

nixpanic commented Apr 2, 2026

/test ci/centos/k8s-e2e-external-storage/1.35/cephfs

@nixpanic nixpanic force-pushed the ai/bob/nfs/ControllerModifyVolume/clients branch 5 times, most recently from 22a917f to 100405b Compare April 3, 2026 08:25
nixpanic added 2 commits April 3, 2026 10:26
The ControllerModifyVolume CSI procedure can now be used to modify the
`clients` parameter that was originally configured in the StorageClass.

The SetClients() method uses the NFS Admin API to update the export on
the cluster (via ExportInfo + CreateCephFSExport) and stores the value
in the journal for persistence.

Removed GetClients() method as the clients parameter is not stored in
the VolumeContext but configured directly in the NFS export on the
server.

Assisted-by: AskBob <askbob@ibm.com>
Signed-off-by: Niels de Vos <ndevos@ibm.com>
Add comprehensive e2e test that verifies the clients parameter can be
modified using VolumeAttributesClass. The test:
- Creates a volume with restrictive clients (1.1.1.1)
- Verifies that an app fails to mount with restrictive settings
- Updates the clients parameter via VolumeAttributesClass to allow all
  clients (0.0.0.0/0)
- Verifies that the app successfully mounts after the update

The test runs just before the cleanup phase to ensure proper test
sequencing.

Assisted-by: AskBob <askbob@ibm.com>
Signed-off-by: Niels de Vos <ndevos@ibm.com>
@nixpanic nixpanic force-pushed the ai/bob/nfs/ControllerModifyVolume/clients branch from 100405b to c27e00a Compare April 3, 2026 08:28
@nixpanic
Copy link
Copy Markdown
Member Author

nixpanic commented Apr 3, 2026

/test ci/centos/k8s-e2e-external-storage/1.35/cephfs

@nixpanic
Copy link
Copy Markdown
Member Author

nixpanic commented Apr 3, 2026

/test ci/centos/mini-e2e-helm/k8s-1.35/cephfs

@nixpanic
Copy link
Copy Markdown
Member Author

nixpanic commented Apr 3, 2026

/test ci/centos/mini-e2e-helm/k8s-1.35/nfs

@nixpanic
Copy link
Copy Markdown
Member Author

nixpanic commented Apr 3, 2026

/test ci/centos/mini-e2e-helm/k8s-1.35

@nixpanic
Copy link
Copy Markdown
Member Author

nixpanic commented Apr 7, 2026

/test ci/centos/mini-e2e/k8s-1.35/cephfs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

component/nfs Issues related to NFS

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant